/*
 * @Author: your name
 * @Date: 2021-01-19 09:44:57
 * @LastEditTime: 2021-01-22 17:47:49
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \wxapp\pages\vehicle\person\service-order\service-order.js
 */
 var t = getApp(),
  a = t.requirejs("core");
Page({
    data: {
        orderType: [
            {
                type: 0,
                title: '全部'
            },
            {
                type: 1,
                title: '待付款'
            },
            {
                type: 2,
                title: '待服务'
            },
            {
                type: 3,
                title: '已完成'
            },
        ],
        orderList: [
            /*{
                orderId: 'SH43403922',
                status: 1,
                imageUrl: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=4279714354,3944998210&fm=26&gp=0.jpg',
                name: '测试',
                service: '测试服务',
                address: '广东省惠州市惠城区下铺路12号11楼',
                price: '93.00',
            },
            {
                orderId: 'SH303203923',
                status: 2,
                imageUrl: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=4279714354,3944998210&fm=26&gp=0.jpg',
                name: '测试2',
                service: '测试2服务',
                address: '广东省惠州市惠城区下铺路12号12楼',
                price: '94.00',
            },*/
        ]
    },
    onClick(t) {
        var  id = a.pdata(t).id;
        wx.navigateTo({
            url: '/pages/vehicle/person/order-detail/order-detail?id='+id,
        });
    },
    onLoad: function (a) {
      this.getList()
    },
    getList: function () {
        var t = this;
           a.get("vehicle/order/get_list", {
          }, function (a) {
                t.setData({
                    orderList: a.list
                })
                console.log(a.list)
          })
    },
    onChange: function (e) {
        var t = this;
           a.get("vehicle/order/get_list", {
            status:e.detail.index
          }, function (a) {
                t.setData({
                    orderList: a.list
                })
          })

      console.log(e.detail.index)
    },
    payOrder(t){
        var  id = a.pdata(t).id;
        wx.navigateTo({
            url: '/pages/vehicle/order/pay/index?id='+id,
        });
    }
})